package exam.web;

import exam.config.SpringConfiguration;
import exam.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserController {
    public static void main(String[] args) {
//        ClassPathXmlApplicationContext ctx=new ClassPathXmlApplicationContext("applicationContext.xml");
        ApplicationContext ctx=new AnnotationConfigApplicationContext(SpringConfiguration.class);
        UserService userService = (UserService) ctx.getBean("userService");
//        UserService userService = ctx.getBean(UserService.class);
        userService.save();

    }
}
